<?php

namespace app\models\Child;

use Yii;

/**
 * This is the model class for table "init_disease_info".
 *
 * @property integer $desc_id
 * @property integer $type_id
 * @property string $desc_name
 * @property integer $disease_score
 */
class InitDiseaseInfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'init_disease_info';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['type_id', 'disease_score'], 'integer'],
            [['desc_name'], 'string', 'max' => 300],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'desc_id' => 'Desc ID',
            'type_id' => 'Type ID',
            'desc_name' => 'Desc Name',
            'disease_score' => 'Disease Score',
        ];
    }
    
    /*
     * 查询列表
     */
    public function getList()
    {
	$list = $this->find()
		->select('init_disease_type.type_id,init_disease_type.type_name,init_disease_type.is_main,init_disease_info.desc_id,init_disease_info.desc_name,init_disease_info.disease_score')
		->join('left join','init_disease_type','init_disease_type.type_id = init_disease_info.type_id')
		->where(['type_status' => 1,'is_main' => 1])
		->asArray()
		->all();
	return $list;
    }
}
